A virtual machine (VM) is a portion of software that, when executed on appropriate hardware, creates an environment allowing the virtualization of an actual physical computer system (e.g., a server, a mainframe computer, etc.). The actual physical computer system is typically referred to as a “host machine” or a “physical machine,” and the operating system of the host machine is typically referred to as the “host operating system.”
A virtual machine may function as a self-contained platform, executing its own “guest” operating system and software applications. Typically, software on the host machine known as a “hypervisor” (or a “virtual machine monitor”) manages the execution of one or more virtual machines, providing a variety of functions such as virtualizing and allocating resources, context switching among virtual machines, etc.
A virtual machine may comprise one or more “virtual processors,” each of which maps, possibly in a many-to-one fashion, to a central processing unit (CPU) of the host machine. Similarly, a virtual machine may comprise one or more “virtual devices,” each of which maps, typically in a one-to-one fashion, to a device of the host machine (e.g., a network interface device, a CD-ROM drive, a hard disk, a solid-state drive, etc.). A virtual machine may also comprise a “virtual virtual memory” that maps memory locations of the virtual machine, typically organized into pages, to virtual memory locations of the host operating system, via a paging table for the virtual machine. The virtual memory locations of the host operating system, also typically organized into pages, are then mapped by the host OS to physical memory locations, via the host operating system's paging table. The hypervisor manages these mappings in a transparent fashion, thereby enabling the guest operating system and applications executing on the virtual machine to interact with the virtual processors and virtual devices as though they were actual physical entities.
Typically, a hypervisor enables the cloning of virtual machines via one of two techniques: via a direct-copy command, and via a copy-on-write command. In direct-copy, a source virtual machine is cloned by allocating and creating a new destination virtual machine that is an exact replica of the source virtual machine. In copy-on-write, a source virtual machine is cloned by creating a new pointer to the source virtual machine, so no new virtual machine is created. As expected, changes to the source virtual machine are also mirrored in the “clone” VM accessed via the pointer.